// Register page module
// ====================

define(['zepto', 'chart', 'sui' ], function($, Chart) {
  return {
    init: function(data) {
	    this.physicalAttrScores = parseInt(data.physicalAttrScores);
	    this.sportsKnowledgeScores = parseInt(data.sportsKnowledgeScores);
	    this.exerciseRegularlyScores = parseInt(data.exerciseRegularlyScores);
	    this.physicalMentalPleasureScores = parseInt(data.physicalMentalPleasureScores);
	    this.sportsPracticeSkillScores = parseInt(data.sportsPracticeSkillScores);
    
      this.initChart();
    },
    initChart: function() {
      var that = this;
      var ctx = document.getElementById("ftShareChart").getContext("2d");
      var data = {
          labels : ["执行力","知识储备","运动心理","实践技能","身体属性"],
          datasets : [
            {
              fillColor : "rgba(193, 193, 193, 0.8)", // 背景色
              strokeColor : "rgba(193, 193, 193, 0.8)", // 线
              pointColor : "#bdab49", // 点
              pointStrokeColor : "#bdab49", 
              data : [that.physicalAttrScores,that.sportsKnowledgeScores,that.exerciseRegularlyScores,that.physicalMentalPleasureScores,that.sportsPracticeSkillScores]
            }
          ]
        }
      var options = {
          scaleLineColor : "#313131",
          scaleFontColor : "#313131",
          angleLineColor : "#313131",
          pointLabelFontColor : "#313131",
          pointDot: false
        }
      
      new Chart(ctx).Radar(data, options);
    },
  }
})